/* Copyright 2011-2016 Adobe Systems Incorporated. All Rights Reserved. */ (function(a,b,c,d,g){c.Plugins.SlideShowCaptions={defaultOptions:{captionClassName:"SSSlideCaption"},initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b.bind("attach-behavior",function(){d._attachBehavior(b)})},_attachBehavior:function(a){var b=a._sscpCaptions?a._sscpCaptions:a._findWidgetElements("."+a.options.captionClassName);if(b.length)a._sscpCaptions=b,b.css("display","none"),a.slides.bind("wp-panel-show",function(a,c){b.eq(c.panelIndex).css("display","block")}), a.slides.bind("wp-panel-hide",function(a,c){b.eq(c.panelIndex).css("display","none")}),a.bind("ready",function(){-1!=a.slides.activeIndex&&b.eq(a.slides.activeIndex).css("display","block")})}};c.Plugins.SlideShowLabel={defaultOptions:{labelClassName:"SlideShowLabel"},initialize:function(b,c){var d=this;a.extend(c,a.extend({},d.defaultOptions,c));b.bind("attach-behavior",function(){d._attachBehavior(b)})},_attachBehavior:function(a){var b=this,c=a._$sslpLabels?a._$sslpLabels:a._findWidgetElements("."+ a.options.labelClassName);if(c.length)a._$sslpLabels=c,a.slides.bind("wp-panel-show",function(){b._updateLabels(a)}),a.bind("ready",function(){b._updateLabels(a)})},_findAllTextNodes:function(a,b){b=b||[];switch(a.nodeType){case 3:b.push(a);break;case 1:if(a.nodeName.toLowerCase()!=="script")for(var c=a.firstChild;c;)this._findAllTextNodes(c,b),c=c.nextSibling}a.nextSibling&&this._findAllTextNodes(a.nextSibling,b);return b},_updateLabels:function(a){var b=this,c=a.slides,d=c.activeIndex+1,g=c.$element.length; a._$sslpLabels.each(function(){for(var a=b._findAllTextNodes(this),c=a.length,f=0,h=function(a){return++f===1?d:f===2?g:a},p=0;p").attr("id",i.attr("id")||"").css({left:0,top:0,width:"auto",height:"auto",padding:0,margin:0,zIndex:"auto"}),t;g&&(t=a("
"),d.elastic==="fullScreen"?t.addClass("fullscreen"):d.elastic==="fullWidth"&& t.addClass("fullwidth"),t.css({paddingLeft:i.css("padding-left"),paddingRight:i.css("padding-right"),paddingTop:i.css("padding-top"),paddingBottom:i.css("padding-bottom"),borderColor:i.css("border-left-color"),borderStyle:i.css("border-left-style"),borderLeftWidth:i.css("border-left-width"),borderRightWidth:i.css("border-right-width"),borderTopWidth:i.css("border-top-width"),borderBottomWidth:i.css("border-bottom-width")}),t.append(c.Utils.includeMEditableTags(l)),t.append(c.Utils.includeMEditableTags(p)), n.css({border:"none"}));i.removeAttr("id");var q=a("
").addClass("overlayWedge").insertBefore(c.Utils.includeMEditableTags(k)[0]);n.append(c.Utils.includeMEditableTags(i.children().not("."+d.slideClassName)));i.append(c.Utils.includeMEditableTags(k));n.css({visibility:"hidden"}).appendTo(document.body);n.detach().css({visibility:""});l.css({position:d.elastic==="fullScreen"?"relative":"absolute",padding:0,left:d.elastic==="fullWidth"?"":0,top:0,borderWidth:0,background:"none"});d.elastic!=="fullScreen"&& l.css({width:o,height:r});d.transitionStyle==="fading"&&k.css({position:"absolute",left:0,top:0});var y;if(b._fstpPositionSlides||b._csspResizeFullScreenImages)y=function(a,c){b._fstpPositionSlides&&b._fstpPositionSlides(a,c);b._csspResizeFullScreenImages&&b._csspResizeFullScreenImages(b,b.slides.$element,d.heroFitting)};l=a("
").addClass("LightboxContent").css({position:"absolute"}).append(g?t:l);g||l.append(c.Utils.includeMEditableTags(p));l.museOverlay({autoOpen:!1,$slides:k,$overlaySlice:n, $overlayWedge:q,slideshow:b,onNext:function(){b.next()},onPrevious:function(){b.previous()},onClose:function(){b.stop();b.slides.hidePanel(b.slides.activeElement);b.tabs.activeElement.focus()},$elasticContent:t,resizeSlidesFn:y});if(a.browser.msie&&a.browser.version<9){c.Assert.assert(!c.Utils.isIBE(),"IBE doesn't support ").addClass(d.clipClassName),k=b._findWidgetElements("."+d.slideClassName),l=k.outerWidth(),k=k.outerHeight();b.$clipElement=i;if(d.elastic==="fullScreen")i.addClass("fullscreen");else{var b={position:"relative",width:l+"px",height:k+"px",overflow:"hidden"},m=g.css("position");if(m==="absolute")b.position=m,b.left=g.css("left"),b.top= g.css("top");else if(m==="fixed"){var o=c.Utils.getStyleSheetRulesById(c.Utils.getPageStyleSheets(),g.get(0).id);b.position=m;b.left=c.Utils.getRuleProperty(o,"left");b.top=c.Utils.getRuleProperty(o,"top");b.bottom=c.Utils.getRuleProperty(o,"bottom");b.right=c.Utils.getRuleProperty(o,"right")}i.css(b)}d.elastic!=="fullScreen"&&g.css({width:l+"px",height:k+"px"});return i},_transformMarkup:function(a){var b=a.options,c=a._findWidgetElements("."+b.viewClassName);b.transitionStyle!=="fading"?(b=this._updateClipElement(a), c.css({position:"relative",top:"0",left:"0",margin:"0",overflow:"hidden"}).wrap(b)):(a=c.css("position"),b.elastic!=="fullScreen"&&a!=="fixed"&&c.css({width:"0",height:"0"}))},_attachBehavior:function(b){var g=this,h=b.options,i=b.tabs,k=b.slides.$element,l=h.slideLinkActiveClassName,m=h.contentLayout_runtime==="lightbox";if(h.elastic!=="off"&&(g._resizeFullScreenImages(b,b.slides.$element,h.heroFitting),!m))a(d).on("orientationchange resize",function(){g._resizeFullScreenImages(b,b.slides.$element, h.heroFitting)});if(m&&!h.autoActivate_runtime)h.hideAllContentsFirst=!0;if(i){var o=i.$element;h.event==="mouseover"&&o.bind("mouseenter",function(){var b=a(this);b.data("enter",!0);i.selectTab(o.index(b))});h.deactivationEvent==="mouseout_trigger"?o.bind("mouseleave",function(){var c=a(this);c.data("enter",!1);b.slides.hidePanel(o.index(c))}):h.deactivationEvent==="mouseout_both"&&(o.bind("mouseleave",function(){var c=a(this),d=o.index(c),g=k.eq(d);c.data("enter",!1);c.data("setTimeout")||(c.data("setTimeout", !0),setTimeout(function(){!g.data("enter")&&!c.data("enter")&&b.slides.hidePanel(d);c.data("setTimeout",!1)},300))}),k.bind("mouseenter",function(){a(this).data("enter",!0)}),k.bind("mouseleave",function(){var c=a(this),d=k.index(c),g=o.eq(d);c.data("enter",!1);g.data("setTimeout")||(g.data("setTimeout",!0),setTimeout(function(){!c.data("enter")&&!g.data("enter")&&b.slides.hidePanel(d);g.data("setTimeout",!1)},300))}))}i&&l&&(h.hideAllContentsFirst||i.$element.each(function(c){c==b.slides.activeIndex? a(this).addClass(l):a(this).removeClass(l)}),b._findWidgetElements("a."+l).each(function(){a(this).data("default-active",!0)}),b.slides.bind("wp-panel-show",function(a,b){i.$element.eq(b.panelIndex).addClass(l)}).bind("wp-panel-hide",function(a,b){var c=i.$element.eq(b.panelIndex);c.data("default-active")||c.removeClass(l)}));g._attachStopOnClickHandler(b,b.$firstBtn);g._attachStopOnClickHandler(b,b.$lastBtn);g._attachStopOnClickHandler(b,b.$previousBtn);g._attachStopOnClickHandler(b,b.$nextBtn); g._attachStopOnClickHandler(b,b.$playBtn);g._attachStopOnClickHandler(b,b.$stopBtn);g._attachStopOnClickHandler(b,b.$closeBtn);i&&!m&&g._attachStopOnClickHandler(b,i.$element);b._csspIsImageSlideShow||(b.slides.bind("wp-panel-hide",function(b,d){c.Utils.detachIframesAndObjectsToPauseMedia(a(d.panel))}).bind("wp-panel-show",function(d,g){setTimeout(function(){c.Utils.attachIframesAndObjectsToResumeMedia(a(g.panel))},b.options.transitionDuration)}),k.each(function(){this!=b.slides.activeElement||h.hideAllContentsFirst? c.Utils.detachIframesAndObjectsToPauseMedia(a(this)):c.Utils.attachIframesAndObjectsToResumeMedia(a(this))}));b.bind("wp-swiped",function(){(b.options.autoPlay||b._sslbpAutoPlay)&&b.options.resumeAutoplay&&0=c.x&&a.pageX<=c.x+c.width&& a.pageY>=c.y&&a.pageY<=c.y+c.height},_layoutThumbs:function(b){var d=b.options,g=c.Utils.getStyleValue;b._findWidgetElements("."+d.slideLinksClassName).each(function(){var b=a(this).find("."+d.slideLinkClassName);firstThumb=b[0];tWidth=g(firstThumb,"width");tHeight=g(firstThumb,"height");gapH=g(firstThumb,"margin-right");gapV=g(firstThumb,"margin-bottom");borderL=g(firstThumb,"border-left-width");borderR=g(firstThumb,"border-right-width");borderT=g(firstThumb,"border-top-width");borderB=g(firstThumb, "border-bottom-width");gWidth=g(this,"width");paddingL=g(this,"padding-left");paddingT=g(this,"padding-top");maxNumThumb=Math.floor((gWidth+gapH)/(tWidth+borderL+borderR+gapH));gStyle=this.runtimeStyle?this.runtimeStyle:this.style;numRow=Math.ceil(b.length/maxNumThumb);firstRowNum=b.lengthfirstRowNum&&(numInRow=1,leftPos=leftMostPos,topPos+=tHeight+borderT+borderB+gapV);numInRow++>1&&(leftPos+=tWidth+borderL+borderR+gapH);var a=this.runtimeStyle?this.runtimeStyle:this.style;a.marginRight="0px";a.marginBottom="0px";a.left=leftPos+"px";a.top=topPos+"px"})})},_resizeFullScreenImages:function(b,c,d){c.each(function(){a(this).find("img").each(function(){this.complete&&!a(this).hasClass(b.options.imageIncludeClassName)&&b._csspPositionImage(this, d,b.options.elastic)})})},_setupImagePositioning:function(b,c,d,g){var k=this;c.each(function(){a(this).find("img").each(function(){var b=this;b.complete?k._positionImage(b,d,g):a(b).load(function(){k._positionImage(b,d,g)})})})},_positionImage:function(b,j,h,i,k){var l=a(d),m=b.runtimeStyle?b.runtimeStyle:b.style,o=h==="fullWidth"||h==="fullScreen",r=h==="fullHeight"||h==="fullScreen",p=j=="fitContentProportionally";$img=a(b);o=o?d.innerWidth?d.innerWidth:l.width():p?$img.data("width"):$img.parent().width(); l=r?d.innerHeight?d.innerHeight:l.height():p?$img.data("height"):$img.parent().height();i=i!==g?i:c.Utils.getNaturalWidth(b);b=k!==g?k:c.Utils.getNaturalHeight(b);h!=="off"&&(i===0&&(i=$img.data("imageWidth")),b===0&&(b=$img.data("imageHeight")));if(o==i&&l==b)m.marginTop="0px",m.marginLeft="0px";else{r=i;k=b;if(j=="fillFrameProportionally"){if(h!=="off"||i>o&&b>l)j=i/o,h=b/l,jo||b>l))j=i/o,h=b/l,j>h?(k=b/j,r=i/j):(k= b/h,r=i/h);m.width=c.Utils.pixelRound(r)+"px";m.height=c.Utils.pixelRound(k)+"px";m.marginTop=c.Utils.pixelRound((l-k)/2)+"px";m.marginLeft=c.Utils.pixelRound((o-r)/2)+"px"}}};a.extend(b.Widget.ContentSlideShow.slideImageIncludePlugin.defaultOptions,{imageIncludeClassName:"ImageInclude",slideLoadingClassName:"SSSlideLoading"});b.Widget.ContentSlideShow.prototype.defaultPlugins=[c.Plugins.ContentSlideShow];b.Widget.ContentSlideShow.prototype._getAjaxSrcForImage=function(b){for(var c=a(d).data("ResolutionManager").getDataSrcAttrName(), g=c.length,i,k=0;k